package com.linq.cool.common.core.exception;

/**
 * @Author: yqlin
 * @Date: 2021/1/11 04:12
 * @Description: 自定义异常
 * @Version: 1.0.0
 */
public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 1L;
    private final String message;
    private Integer code;


    public BusinessException(String message) {
        this.message = message;
    }

    public BusinessException(String message, Integer code) {
        this.message = message;
        this.code = code;
    }

    public BusinessException(String message, Throwable e) {
        super(message, e);
        this.message = message;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public Integer getCode() {
        return code;
    }
}
